Previously, the mere presence of a CARGO_INCREMENTAL variable in the
environment caused incremental compilation to happen. This has the very
unintuitive effect that `CARGO_INCREMENTAL=0` and even
`CARGO_INCREMENTAL=` mean incremental compilation is *on*.
This change brings the semantics in line with how they are defined in
the tests (cf. tests/build.rs:45), and in public-facing documentation
(https://internals.rust-lang.org/t/incremental-compilation-beta/4721).
// Enable incremental builds if the user opts in. For now,
// this is an environment variable until things stabilize a
// bit more.
- let incremental_enabled = env::var("CARGO_INCREMENTAL").is_ok();
+ let incremental_enabled = match env::var("CARGO_INCREMENTAL") {
+ Ok(v) => v == "1",
+ Err(_) => false,
+ };
Ok(Context {
ws: ws,